<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()
const username = ref('')
const password = ref('')
const email = ref('')

function goLogin() {
  router.push('/login/login')
}

function submitRegist() {
  // 暂不实现注册逻辑
}
</script>

<template>
  <div class="form">
    <h2>注册</h2>
    <label>
      用户名
      <input v-model.trim="username" placeholder="请输入用户名" />
    </label>
    <label>
      密码
      <input type="password" v-model.trim="password" placeholder="请输入密码" />
    </label>
    <label>
      邮箱
      <input type="email" v-model.trim="email" placeholder="请输入邮箱" />
    </label>
    <button class="primary" @click="submitRegist">注册</button>
    <button class="link" @click="goLogin">返回登录</button>
  </div>
  
</template>

<style scoped>
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
}
button.primary {
  margin-top: 8px;
  padding: 10px 12px;
  background: #52c41a;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
button.link {
  padding: 8px 0;
  background: transparent;
  color: #1677ff;
  border: none;
  cursor: pointer;
}
</style>


